/*
 * @Descripttion:
 * @version:
 * @Author: kl2018
 * @Date: 2019-03-07 20:06:20
 * @LastEditors: kl2018
 * @LastEditTime: 2020-08-10 14:32:25
 */

import React from 'react';
import { Modal } from 'antd';
import { hashHistory } from 'react-router';
import { WeaLocaleProvider } from 'ecCom';
import * as test from '../apis/testApi';
import * as LOGIN_API from '../apis/loginApi';

const getLabel = WeaLocaleProvider.getLabel;

export default class Test extends React.Component {
  componentDidMount() {
    test.test().then(() => {

    });
  }

  render() {
    return (<div>test    <a onClick={this.logout}>退出</a></div>);
  }

  logout() {
    Modal.confirm({
      title: getLabel('131329', '信息确认'),
      content: '确定要退出系统吗？',
      okText: getLabel('163', '是'),
      cancelText: getLabel('30587', '否'),
      onOk() {
        LOGIN_API.logout().then(() => hashHistory.push('/'));
      },
      onCancel() {
      },
    });
  }
}
